%% PrintCards.tex - Printing cards chapter
%% Created by Robert Heller on Sat Mar 14 21:58:34 1992
%%
%% ------------------------------------------------------------------
%% Home Libarian by Deepwoods Software
%% ------------------------------------------------------------------
%% Modification History:
%% ------------------------------------------------------------------
%% Contents:
%% ------------------------------------------------------------------
%% 
%% 
%% Copyright (c) 1991,1992 by Robert heller (D/B/A Deepwoods Software)
%%        All Rights Reserved
%% 
%%
\chapter{Printing Cards.}
\index{card catalog db@{\bf card catalog db}!printing cards from}
\label{PrintCards}

\newcommand{\PrintCards}{{\tt PrintCards}}

The \PrintCards\ program is used to generate either $3{\tt x}5$ or
$5{\tt x}8$ cards.  \PrintCards\ can generate a shelf list, an author
index, a title index, or a subject index.  Partial listings can also be
generated. 

\section{Invoking \PrintCards.}

\PrintCards\ is invoked from the command line like this:
\begin{verbatim}

PrintCards -infile <filename> <options>

\end{verbatim} Where \verb+<filename>+ is the file to print cards from
and \verb+<options>+ consist of zero or more of the options listed in
Table~\ref{tab:prcardopts}.

\begin{table}
\caption{\PrintCards\ options}
\label{tab:prcardopts}

\begin{tabular}{|l|l|}
\hline
Syntax&Description \\
\hline
\verb+-largep true|false+&\vtop{\hsize=2in 
\savetolerance=\tolerance
\tolerance=4000
Selects between large ($5{\tt
x}8$) or small ($3{\tt x}5$) cards.  If \verb+true+ large cards are
generated and if \verb+false+ small cards are generated.
\tolerance=\savetolerance
} \\
%
\verb+-by id|title|author|subject+&\vtop{\hsize=2in 
\savetolerance=\tolerance
\tolerance=4000
Selects the type
of card to generate: shelf list cards (\verb+id+), title cards
(\verb+title+), author cards (\verb+author+), or subject cards
(\verb+subject+).
\tolerance=\savetolerance
} \\
%
\verb+-only <expression>+&\vtop{\hsize=2in Used to select a subset of
cards to generate. \verb+<expression>+ is a relational expression
comparing fields to selected values.} \\
\hline
\end{tabular}

\end{table}
The expression\index{only-expr@{\bf -only expression}|bold} can contain the 
operators listed in Table~\ref{tab:exprops}\footnote{Because some of
these operators might be interpreted by the command processor (shell),
it may be necessary to escape or quote the expression string.}. 
\begin{table}
\caption{Expression operators}
\label{tab:exprops}
\index{only-expr@{\bf -only expression}!operators in}

\begin{tabular}{|l|l|}
\hline
Operator&Meaning \\
\hline
\verb+<+&Less than \\
\verb+>+&Greater than \\
\verb+=+&Equal to \\
\verb+!=+&Not Equal to \\
\verb+<=+&Less than or Equal to \\
\verb+>=+&Greater than or Equal to \\
\verb+&+&And \\
\verb+|+&Or \\
\verb+!+&Not \\
\verb+(...)+&Expression grouping \\
\verb+"..."+&String constant \\
\hline
\end{tabular}

\end{table}
Each relational expression needs to specify a field name and a value. 
The value must be of the correct type as shown in
Table~\ref{tab:prfieldtypes}.
\begin{table}
\caption{Field types}
\label{tab:prfieldtypes}

\index{only-expr@{\bf -only expression}!field types in}

\begin{tabular}{|l|l|}
\hline
Field&Type \\
\hline
\verb+type+&Type name (see Table~\ref{tab:cardtypes}) \\
\verb+author+&String constant \\
\verb+title+&String constant \\
\verb+publisher+&String constant \\
\verb+city+&String constant \\
\verb+volume+&Integer constant \\
\verb+year+&Integer constant \\
\hline
\end{tabular}

\end{table}
Some example expressions:
\index{only-expr@{\bf -only expression}!examples of|(}

\begin{verbatim}
author="Norton, Andre"&type=Book

year>1990&type=CD

type=CD|type=Album

publisher="Random House"&city="New York, NY"

type=CD&author="Guns and Roses"

type=EightTrack&author="Hank Williams, Jr."

type=EightMM

title="The Door Into Summer"
\end{verbatim}
\index{only-expr@{\bf -only expression}!examples of|)}

\section{\PrintCards\ Output.}

The output of \PrintCards\ is to the standard output stream.  This can
be redirected with the output redirection command line character
(\verb+>+) or piped with the pipe character (\verb+!+ under OSK or
\verb+|+ under MS-DOS).  The output is meant for continous pin-fed index
cards. 
